//
//  BJTextView.m
//  Kingka
//
//  Created by  on 2023/12/13.
//

#import "BJTextView.h"

@implementation BJTextView

- (instancetype)init{
    if(self = [super init]){
        self.addChild(self.bgView);
        self.bgView.addChild(self.textView);
        self.bgView.addChild(self.currentText);
        self.bgView.makeCons(^{
            make.leading.trailing.constants(0);
            make.bottom.constants(0);
            make.top.constants(0);
        });
        self.textView.makeCons(^{
            make.edge.constants(0);
        });
        self.currentText.makeCons(^{
            make.trailing.constants(-12);
            make.bottom.constants(-18);
        });
        self.currentText.text = @"0/500";
        self.currentText.textColor = [UIColor colorWithHexString:@"#8A8A8A"];
        self.currentText.font = [UIFont systemFontOfSize:11];
    }
    return self;
}

- (UITextView *)textView{
    AsGetMethodReturnObjc(_textView);
    _textView = TextView;
    _textView.textColor = [UIColor colorWithHexString:@"#333333"];
    _textView.font = [UIFont systemFontOfSize:14];
    [_textView ner_setPlaceholderText:@"Start your creation..."];
    _textView.backgroundColor = UIColor.clearColor;
    return _textView;
}

- (UIView *)bgView{
    AsGetMethodReturnObjc(_bgView);
    _bgView = View;
//    _bgView.layer.cornerRadius = 6;
//    _bgView.layer.masksToBounds = YES;
//    _bgView.backgroundColor = [UIColor colorWithHexString:@"#FAFAFA"];
//    _bgView.layer.borderColor = [UIColor colorWithHexString:@"#DDDDDD"].CGColor;
//    _bgView.layer.borderWidth = 1;
    return _bgView;
}

- (UILabel *)currentText{
    AsGetMethodReturnObjc(_currentText);
    _currentText = Label;
    return _currentText;
}

@end
